﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Board : MonoBehaviour 
{
    public enum Belong
    {
        Player,
        AI
    }

    /// <summary>
    /// 归属于.
    /// </summary>
    [SerializeField]
    private Belong _belongTo;

    private void OnTriggerEnter2D(Collider2D other)
    {
        //检测是否碰撞到了球.
        if (other.CompareTag("Ball"))
        {
            Debug.Log("游戏结束");
            GameManager.Instance.GameFinished(_belongTo);
            Destroy(other.gameObject);
        }
    }
}
